﻿using System;
using System.Web.Script.Serialization;

namespace yiCommerce.Core.Helper
{
    public class JsonHelper
    {
        public static string ToJson(object obj)
        {
            var json = new JavaScriptSerializer().Serialize(obj);
            return json;
        }

        public static T ToObject<T>(string json)
        {
             var obj= new JavaScriptSerializer().Deserialize<T>(json);
            return obj;
        }
    }
}